#include "stdafx.h"
#include "ProjectTest.h"
#include "ProjectManager.h"
#include "Version7Controller.h"

CPPUNIT_TEST_SUITE_REGISTRATION( ProjectTest );


ProjectTest::ProjectTest()
{
}


ProjectTest::~ProjectTest()
{
}

void ProjectTest::AddSupportHanger()
{
	Project prj;

	GetProjectManager().SetCurProject(&prj);
	Version7Controller Controller;

	prj.versionController(&Controller);

	SupportHangerPoint pt;
	pt.PrjID(_T("1"));
	pt.SupportHangerID(_T("1"));
	pt.VolumeID(_T("1"));
	SupportHanger* pSH = GetSupportHangerGenerator().Generate(pt);
	prj.GetSupportHangerManager().AddSupportHanger(pSH);

	CPPUNIT_ASSERT(!pSH->Id().IsNull());
	CPPUNIT_ASSERT(prj.GetSupportHangerManager().GetElementCount() == 1);
	CPPUNIT_ASSERT(prj.GetPersistentObjectManager().GetElementCount() == 1);
}